fix: move LLMError into the llm package (#1096)#1112
Open
CoronRing wants to merge 3 commits into
Open
Conversation
8b7d2e6 to
a01c83a
Compare
LLMError now lives in railtracks.llm.errors and inherits from RTLLMError, eliminating the dependency the llm package had on railtracks.exceptions. Also replaces a NodeInvocationError raised inside _litellm_wrapper with ModelError to fix the same cross-package violation. All built_nodes, related tests, and exception tests updated to import from the new location. Closes #1096
a01c83a to
3174685
Compare
Contributor
Author
|
This PR may be addressed by the middleware logics, hence may not need to be addressed right now. @soulFood5632 let me know your thoughts. |
LLMError was moved out of railtracks.exceptions into railtracks.llm.errors as part of the llm package separation (#1096). Update docs/scripts/error_handling.py to import from the new location.
soulFood5632
requested changes
May 27, 2026
| self.message_hist.append(UserMessage(content=user_message)) | ||
| else: | ||
| # the message is malformed from the model | ||
| raise LLMError( |
Member
There was a problem hiding this comment.
THis wasn't super clear from the ticket description so I apologize. Any errors raised in railtracks core should be railtracks errors. It's fine if we pass the LLM error through, but any new error we raise should be a railtracks error.
| notes=[ | ||
| "Tool.parameters must be a set of Parameter objects", | ||
| ], | ||
| raise ModelError( |
Member
There was a problem hiding this comment.
Why was this error changed?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LLMErrorfromrailtracks.exceptionsintorailtracks.llm.errors, inheriting fromRTLLMErrorinstead ofRTError, so thellmpackage no longer imports fromrailtracks.exceptionsNodeInvocationError(a railtracks exception) was being raised insidellm/models/_litellm_wrapper.py; replaced withModelErrorfrom within the llm packagebuilt_nodes, tests) to importLLMErrorfromrailtracks.llmorrailtracks.llm.errorsLLMErrorfromrailtracks.llm.__init__for discoverabilityFiles changed
llm/errors.pyLLMError(RTLLMError)definitionllm/__init__.pyLLMErrorllm/models/_litellm_wrapper.pyLLMErrorfrom..errors; replaceNodeInvocationErrorwithModelErrorexceptions/errors.pyLLMErrorclassexceptions/__init__.pyLLMErrorexportbuilt_nodes/concrete/*.pyNodeInvocationError→ModelErrortest expectationTest plan
test_litellm_wrapper.py— all tests pass, including the updatedModelErrorexpectation for invalid tool parameterstest_structured_tool_call_llm.py— all tests passtest_exceptions.py—LLMErrortests pass with new locationCloses #1096